package com.admin.controller;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import com.admin.service.PetService;
import com.bean.Pet;
@Controller
public class PetController {
	@Autowired
	private PetService PetSercixe; 
	@RequestMapping("/AdminInsertPet")
	public String addPet(@RequestParam(value="mypic")MultipartFile mypic,Pet Pet,HttpServletRequest req,Model model) {
		 return PetSercixe.AdminInsertPet(Pet,req,mypic);
	}
	@RequestMapping("/AdminSelectPet")
	public String AdminSelrctPet(Model model) {
		return PetSercixe.AdminSelectPet(model);
	}
	@RequestMapping("/AdminDeletePet")
	public String AdminDeletePet(int pid,Model model) {
		return PetSercixe.AdminDeletePet(pid,model);
	}
	@RequestMapping("/AdminUpdatePet")
	public String AdminUpdatePet(Pet Pet, Model model)
	{
		return PetSercixe.AdminUpdatePet(Pet, model);
	}
	@RequestMapping("/AdminSelectPetById")
	public String AdminSelectPetById(int pid,Model model) {
		return PetSercixe.AdminSelectPetById(pid, model);
	}
	
}
